package com.neusoft.controller;

import java.util.List;

import com.neusoft.po.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.po.VirtualWalletTransaction;
import com.neusoft.service.VirtualWalletTransactionService;

@RefreshScope // 开启动态刷新
@RestController
@RequestMapping("/VirtualWalletTransactionContorller")
public class VirtualWalletTransactionController {
	@Autowired
	private VirtualWalletTransactionService transactionService;

	@GetMapping("/listTransactionBywalletId/{walletId}")
	public CommonResult<List> listTransactionBywalletId(@PathVariable Integer walletId) {
		List<VirtualWalletTransaction> list = transactionService.listTransactionBywalletId(walletId);
		return new CommonResult(200, "success", list);
	}

	@GetMapping("/listTransactionBystatus/{walletId}/{status}")
	public CommonResult<List> listTransactionBystatus(@PathVariable Integer walletId, @PathVariable String status) {
		List<VirtualWalletTransaction> list = transactionService.listTransactionBystatus(walletId, status);
		return new CommonResult(200, "success", list);
	}
}
